﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.CSS
{
    #region Using Statements

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    #endregion

    /// <summary>
    /// The CSSRule interface is the abstract base interface for any type of 
    /// CSS statement. This includes both rule sets and at-rules. An 
    /// implementation is expected to preserve all rules specified in a CSS 
    /// style sheet, even if the rule is not recognized by the parser. 
    /// Unrecognized rules are represented using the CSSUnknownRule interface.
    /// </summary>
    public class CSSRule
    {
        #region Constants

        public const short UNKNOWN_RULE = 0;
        public const short STYLE_RULE = 1;
        public const short CHARSET_RULE = 2;
        public const short IMPORT_RULE = 3;
        public const short MEDIA_RULE = 4;
        public const short FONT_FACE_RULE = 5;
        public const short PAGE_RULE = 6;

        #endregion

        #region Constructors

        internal CSSRule()
        {
        }

        #endregion

        #region DOM Level 2 CSS Compliance

        /// <summary>
        /// An integer indicating which type of rule this is.
        /// </summary>
        public int type
        {
            get;
            internal set;
        }

        /// <summary>
        /// The parsable textual representation of the rule. This reflects 
        /// the current state of the rule and not its initial value.
        /// </summary>
        public string cssText
        {
            get;
            set;
        }

        /// <summary>
        /// If this rule is contained inside another rule (e.g. a style rule
        /// inside an @media block), this is the containing rule. If this rule
        /// is not nested inside any other rules, this returns null.
        /// </summary>
        public CSSRule parentRule
        {
            get;
            internal set;
        }

        /// <summary>
        /// The style sheet that contains this rule.
        /// </summary>
        public CSSStyleSheet parentStyleSheet
        {
            get;
            internal set;
        }

        #endregion
    }
}
